import {legacy_createStore as createStore,combineReducers} from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage' // defaults to localStorage for web
import {CollApsedReducer} from './reducers/CollapsedReducer'
import {LoadingReducer} from './reducers/LoadingReducer'

const persistConfig = {
  key: 'zss',
  storage,
  blacklist: ['LoadingReducer'] // LoadingReducer will not be persisted
}
const reducer = combineReducers({
    CollApsedReducer,
    LoadingReducer
})

const persistedReducer = persistReducer(persistConfig, reducer)

const store=createStore(persistedReducer);
const persistor=persistStore(store)

export {store,persistor}

/* 
store.dispatch()

store.subsribe()
*/